package org.nebuloop.photo.organizer.util;

import java.util.Calendar;

import org.apache.commons.configuration.Configuration;

/**
 * Holds common configuration for the application
 * 
 */
public final class Config {

  public static final Calendar TODAY = Calendar.getInstance();
  public static final int CURRENT_YEAR = TODAY.get(Calendar.YEAR);
  public static final String DEST_DIR_PATTERN = "destination.dir.pattern";

  // no instance
  private Config() {
  }

  private static Configuration configuraiton;

  public static Configuration getConfiguraiton() {
    return configuraiton;
  }

  public static void setConfiguraiton(Configuration configuraiton) {
    Config.configuraiton = configuraiton;
  }
  
  public static String getString(String name) {
    return configuraiton.getString(name);
  }
  public static String getString(String name, String defaultVal) {
    return configuraiton==null?defaultVal:configuraiton.getString(name, defaultVal);
  }
}
